﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;

namespace WindowsFormsApplication3.入库信息管理
{
    public partial class order_add : Form
    {
        public order_add()
        {
            InitializeComponent();
        }
        //确定
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                // 
                if (text_spcies.Text == "" && text_demand.Text == "" && text_number.Text == "")
                {
                    MessageBox.Show("种类  需求  数目  均不可为空");
                    return;
                }
               // Debug.WriteLine("\n\n"+text_spcies.Text+"\n\n");
                权限管理.permissionManaging.mySql.excute_sql("insert materialOrderTable (species,demand,number,picture,times) values ('"
                   + text_spcies.Text     + "','"
                   + text_demand.Text     + "','"
                   + text_number.Text     + "','"
                   + text_picture.Text    + "','" 
                   + dateTimePicker1.Text + "')");
                Debug.WriteLine("insert materialOrderTable (species,demand,number,picture,time) values ('"
                   + text_spcies.Text + "','"
                   + text_demand.Text + "','"
                   + text_number.Text + "','"
                   + text_picture.Text + "','"
                   + dateTimePicker1.Text + "')");
                this.Dispose();
            }
            catch
            {
                MessageBox.Show("订单增加失败");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                this.Dispose();
            }
            catch
            {

            }
        }
    }
}
